import { createApp } from "vue";

import ElementPlus from "element-plus";
import zhCn from "element-plus/es/locale/lang/zh-cn";
import "element-plus/dist/index.css";
import * as ElementPlusIconsVue from "@element-plus/icons-vue";
import router from "../src/router";
import App from "./App.vue";
import store from "./store";
import "@/assets/index.scss";
import { createPinia } from "pinia";
import piniaPluginPersistedstate from "pinia-plugin-persistedstate";
import SpeechInput from "@/components/SpeechInput.vue";

/* 
在基于 Element-ui 写项目的时候，Chrome 提醒：
[Violation] Added non-passive event listener to a scroll-blocking 'mousewheel' event. Consider marking event handler as 'passive' to make the page more responsive.
*/
import "default-passive-events";



const app = createApp(App);
app.component('SpeechInput', SpeechInput)
// 创建 Pinia 实例并使用它
const pinia = createPinia();
pinia.use(piniaPluginPersistedstate);
app.use(pinia);
// 注册所有图标
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component);
}
app
  .use(ElementPlus, {
    locale: zhCn,
  })
  .use(router)
  .use(store)
  .mount("#app");
